from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import os
# dr=webdriver.Edge()
# dr.get(r"file:///D:\xiazai\alert.html")
# dr.find_element(By.ID,'button').click()
# time.sleep(2)
# alert = dr.switch_to.alert
# alert.accept()
import time,os
os.system('allure generate ./allurereport-0 ./allure-html --html')
from selenium import webdriver
from selenium.webdriver.common.by import By
dr=webdriver.Edge()
dr.get(r"file:///D:\xiazai\confirm.html")
dr.find_element(By.ID,'button').click()
alert = dr.switch_to.alert
time.sleep(5)
alert.dismiss()
time.sleep(2)
# import time
#
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# dr=webdriver.Firefox()
# dr.get(r"file:///D:\xiazai\prompt.html")
# dr.find_element(By.ID,'button').click()
# pr=dr.switch_to.alert
# pr.send_keys('web自动化')
# time.sleep(5)
# # pr.dismiss()
# time.sleep(2)
# pr.accept()
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# dr=webdriver.Edge()
# dr.get('https://www.jiuxian.com')
# dr.find_element(By.CLASS_NAME,'headerLogin').click()
# time.sleep(5)
# dr.find_element(By.ID,'userName').send_keys('15649920329')
# time.sleep(2)
# dr.find_element(By.ID,'password').send_keys('Ycy20040102')
# time.sleep(10)
# dr.find_element(By.NAME,'bi_Usuallogin').click()
# time.sleep(2)
# dr.find_element(By.XPATH,'//a[@class="bindSub"]').click()
# time.sleep(2)
# dr.find_element(By.XPATH,'//a[@href="https://member.jiuxian.com/index.htm"]').click()
# time.sleep(4)
# dr.find_element(By.XPATH,'/html/body/div[4]/div[1]/div[2]/div[4]/a[3]').click()
# time.sleep(2)
# pr=Select(dr.find_element(By.NAME,'province'))
# pr.select_by_value('2')
# city = Select(dr.find_element(By.ID,'city'))
# city.select_by_index(1)
# time.sleep(2)
# di=Select(dr.find_element(By.NAME,'district'))
# di.select_by_visible_text('昌平区')
# time.sleep(2)
# from selenium.webdriver.support import expected_conditions as Ec
# from selenium.webdriver.support.wait import WebDriverWait
#
# dr=webdriver.Edge()
# dr.get('http://10.59.9.14:7003/')
# dr.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
# dr.find_element(By.PARTIAL_LINK_TEXT, '登录').click()
# time.sleep(2)
# dr.find_element(By.NAME, 'username').send_keys('15649920329')
# dr.find_element(By.NAME, 'password').send_keys('1234567')
# time.sleep(10)
# dr.find_element(By.XPATH, '/html/body/div[4]/div/div[1]/div[2]/form/div[5]/a').click()
# time.sleep(5)
# c = dr.find_element(By.XPATH, '//*[@id="searchForm"]/div[1]/input')
# c.send_keys('ahds')
# time.sleep(2)
# c.clear()
# time.sleep(2)
# a = dr.find_element(By.XPATH, '/html/body/div[3]/div[1]/div[1]')
# print(a.text)
# dr.implicitly_wait(10)
# c=WebDriverWait(dr,20,0.5).until(Ec.presence_of_element_located((By.PARTIAL_LINK_TEXT,'首页')))
# c.click()
# time.sleep(5)